<style>
	input[type="search"] {
		width: 0px;
	}
</style>

<div class="wrapper-md" ng-controller="UserAddOrUpdateCtrl">
	<div class="panel panel-default">
		<ng-form name="roleAddForm" class="form-horizontal form-validation">
		<div class="panel-heading">
			<h1 class="m-n font-thin h3">
				<span translate="{{vm.title}}"></span>
			</h1>
		</div>
		<div class="panel-body">
			<div class="form-group ">
				<div class="col-md-6">
					<label class="col-md-3 control-label"> <span
						class="text-danger">*</span> <span translate="user.zhanghao"></span>
					</label>
					<div class="col-md-8">
						<input type="text" name="name" class="form-control" name="account"
							id="accountID" ng-model="vm.user.account"
							ng-pattern="app.reg.account" maxlength="32" required
							ng-disabled="vm.isEdit"
							uib-tooltip="{{'common.op.remind1' | translate}}" />
					</div>
				</div>
				<div class="col-md-6">
					<label class="col-md-3 control-label"> <span
							class="text-danger">*</span> <span translate="user.role"></span>
					</label>
					<div class="col-md-8">
						<ui-select multiple ng-model="vm.selectRoles"
								   ui-validate=" '!app.isEmpty($value)' " theme="bootstrap">
							<ui-select-match placeholder="{{'common.select' | translate}}">{{$item.name}}
							</ui-select-match>
							<ui-select-choices
									repeat="role in vm.roleList | filter: $select.search">
								<div ng-bind-html="role.name | highlight: $select.search"></div>
							</ui-select-choices>
						</ui-select>
					</div>
				</div>
			</div>
			<div class="form-group ">
				<div class="col-md-6">
					<label class="col-md-3 control-label"> <span
						class="text-danger">*</span> <span translate="user.yonghuming"></span>
					</label>
					<div class="col-md-8">
						<input type="text" name="name" class="form-control" name="name"
							id="nameID" ng-model="vm.user.name" maxlength="32" required
							uib-tooltip="{{'common.op.remind2' | translate}}" />
					</div>
				</div>
				<div class="col-md-6">
                    <label class="col-md-3 control-label">
                        <span translate="user.youxiang"></span>
					</label>
					<div class="col-md-8">
						<input type="text" class="form-control" name="email" id="emailID"
                               ng-model="vm.user.email" maxlength="128"
                               ng-pattern="app.reg.email"
                               uib-tooltip="{{'user.youxiangjiaoyan' | translate}}" />
					</div>
				</div>
			</div>
			<div class="form-group " ng-if="!vm.isEdit">
				<div class="col-md-6">
					<label class="col-md-3 control-label"> <span
						class="text-danger">*</span> <span translate="user.mima"></span>
					</label>
					<div class="col-md-8">
						<input type="password" class="form-control" name="password"
							id="passwordID" ng-model="vm.user.password" required
							maxlength="20" ng-minlength="app.pwdRule.minLength"
							ng-maxlength="app.pwdRule.maxLength"
							uib-tooltip="{{'common.op.remind17' | translate}}" />
					</div>
				</div>
				<div class="col-md-6">
					<label class="col-md-3 control-label"> <span
						class="text-danger">*</span> <span translate="user.querenmima"></span>
					</label>
					<div class="col-md-8">
						<input type="password" class="form-control" name="pwdName"
							id="pwdID" ng-model="vm.user.pwdName" required maxlength="20"
							ui-validate=" '$value==vm.user.password' "
							ui-validate-watch=" 'vm.user.password' "
							uib-tooltip="{{'user.querenmimatishi' | translate}}" />
					</div>
				</div>
			</div>

			<div class="form-group ">
				<div class="col-md-6">
                    <label class="col-md-3 control-label">
                        <span class="text-danger">*</span>
                        <span translate="user.department"></span>
					</label>
					<div class="col-md-8">
						<select class="input-sm form-control inline v-middle" name="departmentId" id="departmentId"
                                ng-model="vm.user.departmentId" convert-to-number required>
							<option ng-repeat="d in vm.departments" value={{d.value}}>{{d.content}}</option>
						</select>
						<!--<input type="text" class="form-control" name="departmentId" id="departmentId"
							   ng-model="vm.user.departmentId" maxlength="32"
							   uib-tooltip="{{'user.department' | translate}}" />-->
					</div>
				</div>
				<div class="col-md-6">
					<label class="col-md-3 control-label"> <span
							translate="user.chuanzhen"></span>
					</label>
					<div class="col-md-8">
						<input type="text" class="form-control" name="fax" id="fax"
							   ng-model="vm.user.fax" maxlength="32" ng-pattern="app.reg.fox"
							   uib-tooltip="{{'user.chuanzhenhaoma' | translate}}" />
					</div>
				</div>

			</div>
			<div class="form-group ">
				<div class="col-md-6">
					<label class="col-md-3 control-label"> <span
							translate="user.dianhua"></span>
					</label>
					<div class="col-md-8">
						<input type="text" class="form-control" name="telephone"
							   id="telephID" ng-model="vm.user.telephone" maxlength="32"
							   ng-pattern="app.reg.phone"
							   uib-tooltip="{{'user.dianhuajiaoyan' | translate}}"/>
					</div>
				</div>
				<div class="col-md-6">
					<label class="col-md-3 control-label"> <span
							translate="user.dizhi"></span>
					</label>
					<div class="col-md-8">
						<input type="text" class="form-control" name="address"
							   id="address" ng-model="vm.user.address" maxlength="255"
							   uib-tooltip="{{'common.op.remind6' | translate}}" />
					</div>
				</div>

			</div>
			<div class="form-group ">
				<div class="col-md-6">
					<label class="col-md-3 control-label"> <span
							translate="common.remark"></span>
					</label>
					<div class="col-md-8">
						<textarea class="form-control" name="description" id="description"
								  ng-model="vm.user.description" maxlength="255"
								  uib-tooltip="{{'common.op.remind6' | translate}}"></textarea>
					</div>
				</div>
				<!--<div class="col-md-6">
                    <label class="col-md-3 control-label">
                            <span translate="user.suoshuqvyu"></span>
                    </label>
                    <div class="col-md-8">
                        <ul ztree="vm.treeSetting" id="archTree" tree-control="vm.treeObj"
                            tree-data="vm.treeData" class="ztree"></ul>
                    </div>
                </div>-->
			</div>
		</div>
		<footer class="panel-footer text-right bg-light lter">
			<button type="button" class="btn btn-default" ng-click="vm.cancel()"
				translate="common.cancel"></button>
			<button type="button" class="btn btn-primary" ng-click="vm.save()"
				ng-disabled="roleAddForm.$invalid" translate="common.confirm"></button>
		</footer> </ng-form>
	</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                    aria-hidden="true">&times;</button>
                <h4 class="modal-title" translate="nav.pm.staff"></h4>
            </div>
            <div class="modal-body">
                 <div class="row">

                     <div class="col-sm-12 m-b-sm">
            <div class="panel panel-default">
                <!--操作栏-->
                <div class="row wrapper">
                    <div class="col-sm-8 m-b-xs">
                        <input type="text" name="name" class="input-sm form-control w-sm inline v-middle" name="staffName" id="staffNameID"
                               ng-model="vm.query.staffName"
                               maxlength="32"
                               placeholder="{{'pm.staff.name' | translate}}"/>
                        <input class="input-sm form-control w-sm inline v-middle" name="staffpCode" id="staffCodeID" maxlength="32"
                               ng-model="vm.query.staffCode"
                               ng-pattern="app.reg.account"
                               placeholder="{{'pm.staff.code' | translate}}"/>
                    </div>
                    <div class="col-sm-4 m-b-xs">
                        <!--右侧按钮-->
                        <div class="pull-right">
                            <!--查询-->
                            <button class="btn btn-sm btn-primary" ng-click="vm.Search()">
                                <i class="fa fa-search"></i> {{'common.search'|translate}}
                            </button>
                        </div>
                    </div>
                </div>
                <div class="b-b"></div>
                <!--表格-->
                <div class="panel-body">
                    <table id="flexiGrid" flexigrid="vm.options" flexigrid-control="vm.flexigridObj"></table>
                </div>
            </div>
        </div>
    </div>
            </div>
            <!-- <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" ng-click="vm.getStaff()" data-dismiss="modal">完成</button>
            </div> -->
        </div>
    </div>
</div>
</div>